<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:jb="http://java.sun.com/jsf/composite/componentes"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">

        <h:head>            
            <f:loadBundle basename="com.brain.core.i18n.ApplicationResources" var="i18n" />
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <link rel="shortcut icon" href="#{request.contextPath}/recursos/imagenes/ERP_SYSTEM_ICON.png" />
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/recursos/css/default.css" />            
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/primefaces-casablanca/theme.css" />
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/recursos/css/syntaxhighlighter/syntaxhighlighter.css" />
            <script type="text/javascript" src="#{request.contextPath}/recursos/js/script.js" />
            <title><h:outputText value="#{i18n['general.cabecera.titulo.aplicacion']}"/></title>
            <ui:insert name="head"></ui:insert>


        </h:head>

        <h:body >
            <div id="layout" align="center" >
                <div id="top" class="top" align="center" style="background-color: #FFF">
                    <h:panelGrid columns="1">
                        <h:graphicImage value="/recursos/imagenes/LOGO_GREIP.png" rendered="true" height="50" width="250" /> 
                    </h:panelGrid>
                </div>
                <p:separator />    

                <div id="content" style="width: 500px;height: 300px; border: #004276;border-style: solid; border-width: 0px;">


                    <h:outputText value="#{i18n['login.titulo']}" styleClass="tituloPantalla" rendered="false"/>
                    <p:separator rendered="false"/>           
                    <h:form onsubmit="return checkSubmit();"  id="frmLogin" prependId="false" >

                        <p:panel id="pnlLogin">
                            <p:messages id="msgs" showDetail="false" /> 
                            <p:focus for="idFocus" />
                            <h:panelGrid columns="2" cellpadding="5">
                                <h:outputLabel value="#{i18n['login.usuario']}" styleClass="label" />
                                <p:inputText id="idFocus" value="#{loginMBean.usuario}" size="50"   
                                             style="#{applicationMBean.estiloObligatorio}"
                                             label="#{i18n['login.usuario']}" 
                                             required="true" >                                                   
                                </p:inputText>      
                                <h:outputLabel value="#{i18n['login.contrasena']}"
                                               styleClass="label" />
                                <p:password id="isContrasena" value="#{loginMBean.contrasena}" label="#{i18n['login.contrasena']}" 
                                            feedback="false" style="#{applicationMBean.estiloObligatorio}"
                                            size="50" required="true">                                    
                                </p:password>          
                                <h:outputLabel styleClass="label" value="#{i18n['general.label.empresa']}"/>
                                <p:selectOneMenu value="#{loginMBean.empresaDto}"  converter="empresaConvert">
                                    <f:selectItems value="#{loginMBean.listaEmpresas}" var="dto" itemLabel="#{dto.descripcion}" itemValue="#{dto}" /> 
                                </p:selectOneMenu>

                            </h:panelGrid>
                            <p:separator />
                            <h:panelGrid columns="4" cellpadding="5">
                                <p:commandButton icon="ui-icon ui-icon-home" id="btnIngresar" value="#{i18n['login.ingresar']}" 
                                                 action="#{loginMBean.ingresar}" 
                                                 ajax="false" onclick="blockLogin.show()">
                                </p:commandButton> 
                            </h:panelGrid>   
                            <h:outputLabel value="#{sessionMBean.mensajeExpiraSession}" style="color: red; font-weight: bold;" />
                            <p:separator />

                        </p:panel>

                    </h:form> 

                </div>
            </div>
        </h:body>

    </f:view>
</html>